import request from '@/utils/request'

// 查询报名参赛记录列表
export function listApplication(query) {
  return request({
    url: '/sports/application/list',
    method: 'get',
    params: query
  })
}

// 查询报名参赛记录列表
export function listMyApplication(query) {
  return request({
    url: '/sports/application/myList',
    method: 'get',
    params: query
  })
}

// 查询报名参赛记录详细
export function getApplication(applicationId) {
  return request({
    url: '/sports/application/' + applicationId,
    method: 'get'
  })
}

// 新增报名参赛记录
export function addApplication(data) {
  return request({
    url: '/sports/application',
    method: 'post',
    data: data
  })
}

// 修改报名参赛记录
export function updateApplication(data) {
  return request({
    url: '/sports/application',
    method: 'put',
    data: data
  })
}

// 删除报名参赛记录
export function delApplication(applicationId) {
  return request({
    url: '/sports/application/' + applicationId,
    method: 'delete'
  })
}

// 删除报名参赛记录
export function cancelApplication(applicationId) {
  return request({
    url: '/sports/application/cancel',
    method: 'post',
    data: applicationId
  })
}
